home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 3.1 KB | 100 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWFctInf.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef FWFCTINF_H
- #include "FWFctInf.h"
- #endif
-
- #ifndef FWREFCNT_H
- #include "FWRefCnt.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef SOM_ODFacet_xh
- #include <Facet.xh>
- #endif
-
- //========================================================================================
- // Runtime Informations
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwgraphx
- #endif
-
- //========================================================================================
- // class FW_CFacetPartInfo
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CFacetPartInfo::FW_CFacetPartInfo
- //----------------------------------------------------------------------------------------
-
- FW_CFacetPartInfo::FW_CFacetPartInfo():
- fMagicNumber(FW_kMagicNumber),
- fDevice(NULL)
- {
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CFacetPartInfo::InitFacetPartInfo
- //----------------------------------------------------------------------------------------
-
- void FW_CFacetPartInfo::InitFacetPartInfo(Environment* ev, ODFacet* facet)
- {
- fDevice = GraphicDeviceFactory(ev, facet);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CFacetPartInfo::~FW_CFacetPartInfo
- //----------------------------------------------------------------------------------------
-
- FW_CFacetPartInfo::~FW_CFacetPartInfo()
- {
- // ----- Note: We don't delete the window because we don't own it -----
-
- // ----- Release the device -----
- fDevice->Release();
- fDevice = NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CFacetPartInfo::GetFacetPartInfo
- //----------------------------------------------------------------------------------------
-
- FW_CFacetPartInfo* FW_CFacetPartInfo::GetFacetPartInfo(Environment* ev, ODFacet* facet)
- {
- FW_CFacetPartInfo* partInfo = (FW_CFacetPartInfo*)facet->GetPartInfo(ev);
-
- // ----- If partInfo is NULL or doesn't have the right magic number, facet ------
- // ----- was not one of our facet (This can appended in FW_CWindowContext) -----
- if (partInfo == NULL || partInfo->fMagicNumber != FW_kMagicNumber)
- return NULL;
-
- return partInfo;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CFacetPartInfo::GraphicDeviceFactory
- //----------------------------------------------------------------------------------------
-
- FW_CGraphicDevice* FW_CFacetPartInfo::GraphicDeviceFactory(Environment* ev, ODFacet* facet)
- {
- return new FW_CGraphicDevice(ev, facet->GetCanvas(ev)); // refcount of returned device is one
- }
-
-
-